<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
<#assign base=request.contextPath  />
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <title></title>
    <link rel="stylesheet" href="${base}/frame/layui/css/layui.css">
    <link rel="stylesheet" href="${base}/frame/static/css/style.css">
    <link rel="icon" href="${base}/frame/static/image/code.png">
    <script type="text/javascript" src="${base}/js/zhang.js"></script>
    <script   src="${base}/jquery-1.8.3.min.js"></script>
    <style type="text/css">
        .layui-table-fixed-r td{height:58px!important;}
        .layui-table-fixed-r th{height:58px!important;}
        .layui-table img {
            max-width: 48px;min-height: 48px;
        }


        .laytable-cell-3-wx_headimg ,.laytable-cell-1-wx_headimg,.laytable-cell-2-wx_headimg,.laytable-cell-3-wx_headimg,.laytable-cell-4-wx_headimg,.laytable-cell-5-wx_headimg,.laytable-cell-6-wx_headimg,.laytable-cell-7-wx_headimg,.laytable-cell-8-wx_headimg,.laytable-cell-9-wx_headimg,.laytable-cell-10-wx_headimg,.laytable-cell-11-wx_headimg,.laytable-cell-12-wx_headimg,.laytable-cell-13-wx_headimg,.laytable-cell-14-wx_headimg{
            width: 48px!important;;padding:0px!important;height: 48px!important;;
            line-height: 48px!important;;
        }
        .layui-form-item{
            border-bottom: 2px solid #F2F2F2;
        }
        .layui-input-block{
            min-height: 53px;
        }
        img{
            width:110px;height:70px;line-height: 70px;
        }
    </style>
</head>
<body class="body">
<form class="layui-form"  id="form">
    <div class="layui-form-item">
        <label class="layui-form-label"><a style="color:red">*</a>&nbsp;车名</label>
        <div class="layui-input-block">
            <input name="ptName" id="carName" lay-verify=""  placeholder="请输入车名" autocomplete="off" class="layui-input isNull" type="text">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label"><a style="color:red">*</a>&nbsp;车型号</label>
        <div class="layui-input-block">
            <input id="carModel" lay-verify="" placeholder="请输入车型号" autocomplete="off" class="layui-input isNull" type="text">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label"><a style="color:red">*</a>&nbsp;车品牌</label>
        <div class="layui-input-block">
            <input id="carType" lay-verify=""  placeholder="车品牌" autocomplete="off" class="layui-input isNum isNull isPhone" type="text">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label"><a style="color:red">*</a>&nbsp;车牌号</label>
        <div class="layui-input-block">
            <input id="carPland" lay-verify=""  placeholder="请输入车牌号" autocomplete="off" class="layui-input isNull " type="text">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">有无保险</label>
        <div class="layui-input-block">
            <select name="carInsurance" id="carInsurance" lay-verify="required">
                <option value="有">有</option>
                <option value="无">无</option>
            </select>
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label"><a style="color:red">*</a>&nbsp;续航</label>
        <div class="layui-input-block">
            <input id="carRenewal" lay-verify=""  placeholder="请输入续航" autocomplete="off" class="layui-input isNull isNum" type="text">
        </div>
    </div>

    <div  style="float: right;margin-bottom: 50px ; margin-right: 20px;">
        <div class="layui-input-block">
            <button class="layui-btn layui-btn-normal" id="test9"  type="button" onclick="sub()">确定</button>
        </div>
    </div>
</form>
<script type="text/javascript" src="${base}/frame/layui/layui.js"></script>
<script type="text/javascript" src="${base}/js/index.js"></script>
<script>
    layui.use('form', function(){
        var form = layui.form;

    });
function sub(){
    if(!isNull()){
        return;
    }
    if (!isNum()) {
        return;
    }
    if (!isPhone()) {
        return;
    }
    var requestJson={};
    requestJson.carName=$("#carName").val();
    requestJson.carModel=$("#carModel").val();
    requestJson.carBrand=$("#carType").val();
    requestJson.carRenewal=$("#carRenewal").val();
    requestJson.carInsurance=$("#carInsurance").val();
    requestJson.carPlate=$("#carPland").val();
    $.ajax({
        type:"POST",
        url:"${base}/comCarCharge/insertPtCar",
        data:{param:JSON.stringify(requestJson)},
        success:function(data){
            if(data==true){
           window.location.href="${base}/comCarCharge/main.html"
            }else{
                alert("保存失败")
            }
        }
    });

}
</script>
</body>
</html>